package com.findMoneyGame.models {
	import com.findMoneyGame.models.User;

	public class Achievement {
		private var _name = 'I';
		private var _level = 0;
		private var _money = 50;
		private var _invited = 10;
		private var _moneyBought = 00;
		private var _moneySpent = 300;
		private var _reward = 50;
		private var _number = 1;

		public function get name () : String { return _name; }
		public function get level () : int { return _level; }
		public function get money () : int { return _money; }
		public function get invited () : int { return _invited; }
		public function get moneyBought () : int { return _moneyBought; }
		public function get moneySpent () : int { return _moneySpent; }
		public function get reward () : int { return _reward; }
		public function get number () : int { return _number; }

		public function levelAchieved (user : User) : Boolean { return user.level >= _level; }
		public function moneyAchieved (user : User) : Boolean { return user.moneyCount >= _money; }
		public function invitedAchieved (user : User) : Boolean { return true; }
		public function moneyBoughtAchieved (user : User) : Boolean { return user.moneyBought >= _moneyBought; }
		public function moneySpentAchieved (user : User) : Boolean { return user.moneySpent >= _moneySpent; }
		public function achieved (user : User) : Boolean {
			return user.achievement < number &&
				levelAchieved(user) && 
				moneyAchieved(user) && 
				invitedAchieved(user) && 
				moneyBoughtAchieved(user) && 
				moneySpentAchieved(user);
		}
	}
}